package com.nrgedge.magnolia.form.validators;

import info.magnolia.context.MgnlContext;
import info.magnolia.module.form.validators.Validator;

import javax.servlet.http.HttpServletRequest;

import com.nrgedge.magnolia.jcaptcha.JCaptchaServlet;

public class JCaptchaValidator extends Validator {

	public boolean validate(String captchaText) {
		final HttpServletRequest request = MgnlContext.getWebContext().getRequest();

		return JCaptchaServlet.validateResponse(request, captchaText);
	}

}
